﻿namespace Spectral
{
    using System;

    /// <summary>
    /// Provides creational methods for vectors.
    /// </summary>
    public static class Vector
    {
        /// <summary>
        /// Creates a 2-dimensional vector.
        /// </summary>
        /// <typeparam name="T">The element type.</typeparam>
        /// <param name="x">The x element.</param>
        /// <param name="y">The y element.</param>
        /// <returns>A vector.</returns>
        public static Vector2<T> Create<T>(T x, T y)
            where T : struct, IEquatable<T>, IComparable<T>
        {
            return new Vector2<T>(x, y);
        }

        /// <summary>
        /// Creates a 3-dimensional vector.
        /// </summary>
        /// <typeparam name="T">The element type.</typeparam>
        /// <param name="x">The x element.</param>
        /// <param name="y">The y element.</param>
        /// <param name="z">The z element.</param>
        /// <returns>A vector.</returns>
        public static Vector3<T> Create<T>(T x, T y, T z)
            where T : struct, IEquatable<T>, IComparable<T>
        {
            return new Vector3<T>(x, y, z);
        }

        /// <summary>
        /// Creates a 4-dimensional vector.
        /// </summary>
        /// <typeparam name="T">The element type.</typeparam>
        /// <param name="x">The x element.</param>
        /// <param name="y">The y element.</param>
        /// <param name="z">The z element.</param>
        /// <param name="w">The w element.</param>
        /// <returns>A vector.</returns>
        public static Vector4<T> Create<T>(T x, T y, T z, T w)
            where T : struct, IEquatable<T>, IComparable<T>
        {
            return new Vector4<T>(x, y, z, w);
        }
    }
}
